/**
 * 
 */
package com.google.gwt.xhr.server;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Server to test the source code of XMLHttpRequest2
 * 
 */
public class XMLHttpServlet extends HttpServlet {

  public XMLHttpServlet() {

  }

  /**
   * 
   */
  private static final long serialVersionUID = 1L;

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    doPost(req, resp);
  }

  @Override
  public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    resp.setContentType("text/plain");
    PrintWriter w = resp.getWriter();
    w.println(req.getParameter("test"));
  }

}
